package builder;

import java.util.Vector;

import model.Action;

public class FactoryMethodBuilder extends AbstractPatternBuilder {

	private String product = "Product";
	private String concreteProduct = "ConcreteProduct";
	private String creator = "Creator";
	private String concreteCreator = "ConcreteCreator";
	
	public FactoryMethodBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(concreteProduct);
		this.buildClass(concreteCreator);
		
		this.buildAbstractClass(product);
		this.buildAbstractClass(creator);
		
		this.buildDependency(concreteCreator, concreteProduct);
		
		this.buildGeneralization(concreteProduct, product);
		this.buildGeneralization(concreteCreator, creator);
		
		return patternActions;
	}

	@Override
	public void changeNames() {
		
		product = names.get(0);
		concreteProduct = names.get(1);
		creator = names.get(2);
		concreteCreator = names.get(3);

	}
	
	@Override
	public int cantUMLElements() {
		return 4;
	}

}
